package com.tudouji.project.mt.service.impl;

import java.util.List;
import com.tudouji.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tudouji.project.mt.mapper.MtFoodconsumitemMapper;
import com.tudouji.project.mt.domain.MtFoodconsumitem;
import com.tudouji.project.mt.service.IMtFoodconsumitemService;

/**
 * 美团菜品消耗单明细Service业务层处理
 * 
 * @author tudouji
 * @date 2023-11-21
 */
@Service
public class MtFoodconsumitemServiceImpl implements IMtFoodconsumitemService 
{
    @Autowired
    private MtFoodconsumitemMapper mtFoodconsumitemMapper;

    /**
     * 查询美团菜品消耗单明细
     * 
     * @param id 美团菜品消耗单明细ID
     * @return 美团菜品消耗单明细
     */
    @Override
    public MtFoodconsumitem selectMtFoodconsumitemById(Long id)
    {
        return mtFoodconsumitemMapper.selectMtFoodconsumitemById(id);
    }

    /**
     * 查询美团菜品消耗单明细列表
     * 
     * @param mtFoodconsumitem 美团菜品消耗单明细
     * @return 美团菜品消耗单明细
     */
    @Override
    public List<MtFoodconsumitem> selectMtFoodconsumitemList(MtFoodconsumitem mtFoodconsumitem)
    {
        return mtFoodconsumitemMapper.selectMtFoodconsumitemList(mtFoodconsumitem);
    }

    /**
     * 新增美团菜品消耗单明细
     * 
     * @param mtFoodconsumitem 美团菜品消耗单明细
     * @return 结果
     */
    @Override
    public int insertMtFoodconsumitem(MtFoodconsumitem mtFoodconsumitem)
    {
        mtFoodconsumitem.setCreateTime(DateUtils.getNowDate());
        return mtFoodconsumitemMapper.insertMtFoodconsumitem(mtFoodconsumitem);
    }

    /**
     * 修改美团菜品消耗单明细
     * 
     * @param mtFoodconsumitem 美团菜品消耗单明细
     * @return 结果
     */
    @Override
    public int updateMtFoodconsumitem(MtFoodconsumitem mtFoodconsumitem)
    {
        mtFoodconsumitem.setUpdateTime(DateUtils.getNowDate());
        return mtFoodconsumitemMapper.updateMtFoodconsumitem(mtFoodconsumitem);
    }

    /**
     * 批量删除美团菜品消耗单明细
     * 
     * @param ids 需要删除的美团菜品消耗单明细ID
     * @return 结果
     */
    @Override
    public int deleteMtFoodconsumitemByIds(Long[] ids)
    {
        return mtFoodconsumitemMapper.deleteMtFoodconsumitemByIds(ids);
    }

    /**
     * 删除美团菜品消耗单明细信息
     * 
     * @param id 美团菜品消耗单明细ID
     * @return 结果
     */
    @Override
    public int deleteMtFoodconsumitemById(Long id)
    {
        return mtFoodconsumitemMapper.deleteMtFoodconsumitemById(id);
    }
}
